package com.versita.domain;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 * 
 * UserLocation contains UserLocationHistory. UserLocationHistory is just UserLocation.
 * It is used a proxy class so that UserLocation can contain a list of user location in
 * a form of UserLocation class.
 * 
 * @author vmc
 *
 */
@Entity
public class UserLocationHistory {
    /**
     * 
     */
    @SuppressWarnings("unused")
    private static final long serialVersionUID = 7907182246947587760L;

    private int userLocationHistory;
    private GPS gps;
    private Date date;

    public UserLocationHistory() {}

    public UserLocationHistory(UserLocation ul) {
        this.setGps(ul.getGps());
        this.setDate(new Date(ul.getDate().getTime()));
    }

    /**
     * @return the userLocationHistory
     */
    @Id  @GeneratedValue(strategy=GenerationType.AUTO)
    public int getUserLocationHistory() {
        return userLocationHistory;
    }

    /**
     * @param userLocationHistory the userLocationHistory to set
     */
    public void setUserLocationHistory(int userLocationHistory) {
        this.userLocationHistory = userLocationHistory;
    }

    /**
     * @return the gps
     */
    public GPS getGps() {
        return this.gps;
    }
    /**
     * @param gps the gps to set
     */
    public void setGps(GPS gps) {
        this.gps = gps;
    }
    /**
     * @return the date
     */
    public Date getDate() {
        return this.date;
    }
    /**
     * @param date the date to set
     */
    public void setDate(Date date) {
        this.date = date;
    }
}
